<template>
  <div class="home">
    <div class="content-swiper">
      <swiper loop auto height="3.74rem">
        <swiper-item  class="swiper-demo-img" v-for="(item, index) in demoList" :key="index">
          <a :href="item.url?item.url:'#'" style="display:block;height:3.74rem;width:100%;backgroundSize:100%" :style="{backgroundImage: 'url(' +item.images[0].fileUrl+ ')'}"></a>
        </swiper-item>
      </swiper>
    </div>
    <div class="content-menu box">
      <div class="menu-list" @click="linkTo1('/patient/manage')">
        <div class="list-icon"></div>
        <div class="list-text">患者管理</div>
      </div>
      <div class="menu-list" @click="linkTo1('/inquiry/list')">
        <div class="list-icon"></div>
        <div class="list-text">出诊计划</div>
      </div>
      <div class="menu-list" @click="linkTo1('/ask/list')">
        <div class="list-icon"></div>
        <div class="list-text">问诊单</div>
      </div>
      <div class="menu-list" @click="linkTo1('/follow/list')">
        <div class="list-icon"></div>
        <div class="list-text">随访复诊</div>
      </div>
      <div class="menu-list">
        <div class="list-icon"></div>
        <div class="list-text">YOE学院</div>
      </div>
    </div>
    <div class="content-detail">
      <div class="title">推荐有礼</div>
      <div class="detail-bg" @click="linkTo('recommend')"></div>
      <div class="detail-text">
        YOE是中国第一家立足深圳前海、背靠香港和台湾，通过人工智能及区块链前沿技术打造的人工智能共享医疗平台，其集智能诊所、医疗创业平台...
      </div>
    </div>
    <menu-list></menu-list>
  </div>
</template>
<script>
import menuList from './common/navbar-menu'
import { SwiperItem,Swiper } from 'vux'
let CONSTANT = require('../../wechat/static/constant/constant.js'),
    common = require("../../wechat/static/common/common.js"),
    wsService = require("../../wechat/static/common/wechat-jsdk.js");

export default {
  components: {
    SwiperItem,
    Swiper,
    menuList
  },
  data() {
      return {
        list:'',
        demoList:[],
        stateTatus:''
      }
    },
    mounted() {
      this.getBanner()
      this.getState()
    },
    methods: {
      linkTo1(link){
        if(!this.stateTatus ||  this.stateTatus == 'n'){
           this.$router.push('/certificateEdit')
           return;
        }
        if(this.stateTatus == 'w'){
           this.$router.push('/myCertification')
           return;
        }
        this.$router.push(link)
      },
      linkTo(link){
        this.$router.push(link)
      },
      getState(){
        let  url = CONSTANT.URL.DOCTOR.CHECKDETAIL,
            param = {}
        common.requestAjax(url,{},param,(res)=>{
            if(res.status == 200){
                let data = res.data.bussData;
                if(res.data.bussData){
                  this.stateTatus = res.data.bussData.auditStatus
                }
            }else{

            }
        })
      },
      getBanner(){
        let  url = CONSTANT.URL.ACTIVITY.ADLIST,
            param = {pageIndex:1,pageSize:100}
        common.requestAjax(url,{},param,(res)=>{
            if(res.status == 200){
                let data = res.data.bussData;
                this.demoList = data;
            }else{

            }
        })
      },
    }
  };
</script>
<style lang="less">
  .home {
    background-color: #f7f8fe;
    height: 100%;
    .content-menu{
      font-size: .26rem;
      text-align: center;
      background-color: #fff;
      height: 2.01rem;
      .menu-list{
        flex: 1;
        -webkit-box-flex: 1;
        .list-icon{
          background-image: url(../images/patientManage.png);
          background-size:100%;
          width: .53rem;
          height: .58rem;
          margin: .47rem auto .28rem;
        }
        &:nth-child(2){
          .list-icon{
            background-image: url(../images/visitPlan.png);
            width: .57rem;
          }
        }
        &:nth-child(3){
          .list-icon{
            background-image: url(../images/wenzhendan.png);
            width: .48rem;
          }
        }
        &:nth-child(4){
          .list-icon{
            background-image: url(../images/suifangfuzhen.png);
            width: .55rem;
          }
        }
        &:nth-child(5){
          .list-icon{
            background-image: url(../images/yoe.png);
            width: .69rem;
            height: .57rem;
          }
        }
      }
    }
    .content-detail{
      margin-top: .2rem;
      font-size: .3rem;
      color: #111;
      background-color: #fff;
      padding:  .3rem .32rem .28rem .3rem;
      .title{
        position: relative;
        font-size: .34rem;
        padding-left: .18rem;
        color: #000;
        &:before{
          content: '';
          position: absolute;
          left: 0;
          top: .11rem;
          height: .3rem;
          width: .04rem;
          background-color: #0063AE;
        }
      }
      .detail-bg{
          background-image: url(../images/bg1.png);
          background-size:100%;
          width: 6.87rem;
          height: 1.95rem;
          margin:  .25rem auto .23rem;
      }
    }
    .weui-tabbar__item.weui-bar__item_on .weui-tabbar__label {
      color: #0063AE;
    }
    .vux-slider > .vux-indicator, .vux-slider .vux-indicator-right{
          right: 24px;
         bottom: -16px;
    }
    .vux-slider > .vux-indicator > a > .vux-icon-dot, .vux-slider .vux-indicator-right > a > .vux-icon-dot{
      background-color: #fff;
    }
    .vux-slider > .vux-indicator > a > .vux-icon-dot.active, .vux-slider .vux-indicator-right > a > .vux-icon-dot.active{
      background-color: #0063AE;
    }
  }
</style>

